#include <iostream>
#include "YJLabel.h"

yjlabel_constructor_callback YJLabel::constructor_callback = NULL;
simple_callback_int_return YJLabel::preffered_width = NULL;
simple_callback_int_return YJLabel::preffered_height = NULL;
yjlabel_set_size_callback YJLabel::set_size = NULL;

YJLabel::YJLabel(int parrentId, YWidget * parent, const string &text, bool isHeading,
		bool isOutputField) :
	YLabel(parent, text, isHeading, isOutputField) {
	char * conv_test = (char*)text.c_str();
	 std::cout << "YJLabel created"<<conv_test << std::endl;
	classId = constructor_callback(parrentId, conv_test, isHeading, isOutputField);
}

int YJLabel::preferredWidth() {
	return preffered_width(classId);
}

int YJLabel::preferredHeight() {
	return preffered_height(classId);
}

void YJLabel::setSize(int newWidth, int newHeight) {
	return set_size(classId, newWidth, newHeight);
}

void  YJLabel::test(){
	preferredHeight();
	preferredWidth();
	setSize(5,5);
}
/**
 int main(int argc, char **argv) {
 //  YJLabel *d = new YJLabel(NULL, "test", false, false);
 //YJLabel d (NULL, "test", false, false);
 std::cout << "YJLabel created" << std::endl;
 return 0;
 }**/
